package echo;

import java.util.*;

/**
 * Write a description of class NumeroComposite here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class NumeroComplexoComposite implements INumeroComplexoComponent
{
    private ParteRealLeaf parteRealLeaf;
    private ParteImaginariaLeaf parteImaginariaLeaf;    
    
    /**
     * Constructor for objects of class NumeroComposite
     */
    public NumeroComplexoComposite()
    {
    }

    public void addParteReal(ParteRealLeaf leaf)
    {
          parteRealLeaf = leaf;
    } 
    
    public void addParteImaginaria(ParteImaginariaLeaf leaf) 
    {
          parteImaginariaLeaf = leaf;
    } 
    
    
    public void zerar()
    {  
        parteRealLeaf.zerar();
        parteImaginariaLeaf.zerar();
    }
    
    public void entrarParteReal(Integer base, Integer n)
    {
        parteRealLeaf.entrarParteReal(base, n);
    }    
    
    public void somarParteReal(Integer base, INumeroComplexoComponent numComposite)
    {
        parteRealLeaf.somarParteReal(base, numComposite);
    }      
    
    public void entrarParteImaginaria(Integer base, Integer n)
    {
        parteImaginariaLeaf.entrarParteImaginaria(base, n);
    }    
    
    public void somarParteImaginaria(Integer base, INumeroComplexoComponent numComposite)
    {
        parteImaginariaLeaf.somarParteImaginaria(base, numComposite);
    }        
    
    public String toString()
    {
        return parteRealLeaf.toString() + parteImaginariaLeaf.toString();
    }
    
    public String toBinaryString()
    {
        return parteRealLeaf.toBinaryString() + parteImaginariaLeaf.toBinaryString();
    }

    public String toHexString()
    {
       return parteRealLeaf.toHexString() + parteImaginariaLeaf.toHexString();
    }

    public Integer getParteReal()
    {
        return parteRealLeaf.getParteReal();
    }    

    public Integer getParteImaginaria()
    {
        return parteImaginariaLeaf.getParteImaginaria();
    }    
}
